import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//服务站级别查询
export const stationLevel = params =>axios.get(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/stationLevel`, {params});

//新增的保存
export const saveOne = params => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/saveOne`,  params );

//修改
export const updateByPtId = params => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/updateByPtId`,  params );

//分页查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/getListByPage`,  params );

//启用/停用
export const updateEnableByIds = params => axios.get(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/updateEnableByIds`,  {params} );

//根据id查询
export const selectById = id => axios.get(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/selectById/${id}`);

//根据公司名字查询历史记录
export const queryClaimLabour = params => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/queryClaimLabourByOwnerName`,params);

//导入
export const importExcel = params => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/importExcel`,  params );

//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/getListForExport`, params, {
    responseType: 'blob'
  });


// //根据查询条件导出Excel数据
// export const getListForExport = params => {
//   return axios({
//     url: `${SERVER.CLAIMFAC}/tmClaimLabourPrice/getListForExport`,
//     method: 'post',
//     params: params,
//     responseType: 'arraybuffer'
//   });
// };


//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/tmClaimLabourPrice/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//下发
export const claimFullRelease = params => axios.post(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/claimFullRelease`,  params );

//获取车型
export const getCarModels = (params) => axios.get(`${SERVER.CLAIMFAC}/tmClaimLabourPrice/modelSelect`);
